/**
 * @(#) TrainingFacade.as
 *
 * @date		2009. 02. 25.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (교육)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다.
 */
package com.skt.common_hr.biztrip_sac
{
	import com.skt.common_hr.biztrip_sac.controller.StartupCommand;
	import com.skt.common_hr.common.puremvc.CommonFacade;

	import flash.display.DisplayObject;

	public class BizTripFacade extends CommonFacade
	{
		public static const STARTUP:String 						= 'startup';
		public static const CLOSE_MODULE:String					= 'closeModule';

		public static const CHANGE_VIEW_BIZTRIP_LIST:String		= "changeViewBizTripList";
		public static const MODIFY_DAILY_VIEW:String			= "modifyDailyView";
		public static const MODIFY_DOMESTIC_VIEW:String			= "modifyDomesticView";
		public static const MODIFY_FOREIGN_VIEW:String			= "modifyForeignView";
		public static const READONLY_DAILY_VIEW:String			= "readOnlyDeailyView";
		public static const READONLY_DOMESTIC_VIEW:String		= "readOnlyDomesticView";
		public static const READONLY_FOREIGN_VIEW:String		= "readOnlyForeignView";

		public static const SAVE_DAILY_BIZTRIP_COMPLETE:String		= "saveDailyBizTripComplete";
		public static const SAVE_DAILY_BIZTRIP_FAILED:String		= "saveDailyBizTripFailed";
		public static const SAVE_DOMESTIC_BIZTRIP_COMPLETE:String	= "saveDomesticBizTripComplete";
		public static const SAVE_DOMESTIC_BIZTRIP_FAILED:String		= "saveDomesticBizTripFailed";
		public static const SAVE_FOREIGN_BIZTRIP_COMPLETE:String	= "saveForeignBizTripComplete";
		public static const SAVE_FOREIGN_BIZTRIP_FAILED:String		= "saveForeignBizTripFailed";
		public static const APP_DAILY_BIZTRIP_COMPLETE:String		= "appDailyBizTripComplete";
		public static const APP_DAILY_BIZTRIP_FAILED:String			= "appDailyBizTripFailed";
		public static const APP_DOMESTIC_BIZTRIP_COMPLETE:String	= "appDomesticBizTripComplete";
		public static const APP_DOMESTIC_BIZTRIP_FAILED:String		= "appDomesticBizTripFailed";
		public static const APP_FOREIGN_BIZTRIP_COMPLETE:String		= "appForeignBizTripComplete";
		public static const APP_FOREIGN_BIZTRIP_FAILED:String		= "appForeignBizTripFailed";

		public static const DELETE_BIZTRIP_COMPLETE:String			= "deleteBizTripComplete";
		public static const DELETE_BIZTRIP_FAILED:String			= "deleteBizTripFailed";

		public static const LOAD_DAILY_BIZTRIP_COMPLETE:String		= "loadDailyBizTripComplete";
		public static const LOAD_DAILY_BIZTRIP_FAILED:String		= "loadDailyBizTripFailed";
		public static const LOAD_DOMESTIC_BIZTRIP_COMPLETE:String	= "loadDomesticBizTripComplete";
		public static const LOAD_DOMESTIC_BIZTRIP_FAILED:String		= "loadDomesticBizTripFailed";
		public static const LOAD_FOREIGN_BIZTRIP_COMPLETE:String	= "loadForeignBizTripComplete";
		public static const LOAD_FOREIGN_BIZTRIP_FAILED:String		= "loadForeignBizTripFailed";


		public static const LOAD_BIZTRIP_LIST_COMPLETE:String		= "loadBizTripListComplete";
		public static const LOAD_BIZTRIP_LIST_FAILED:String			= "loadBizTripCodesFailed";
		public static const LOAD_BIZTRIP_CODES_COMPLETE:String		= "loadBizTripCodesComplete";
		public static const LOAD_BIZTRIP_CODES_FAILED:String			= "loadBizTripListFailed";

		public static const LOAD_DAILY_COST_COMPLETE:String		= "loadDailyCostComplete";
		public static const LOAD_DAILY_COST_FAILED:String		= "loadDailyCostFailed";
		public static const LOAD_DAILY_COST_FOREIGN_COMPLETE:String		= "loadDailyCostForeignComplete";
		public static const LOAD_DAILY_COST_FOREIGN_FAILED:String		= "loadDailyCostForeignFailed";

		public static const LOAD_MEMBER_COMPLETE:String			= "loadMemberComplete";
		public static const LOAD_ORGLIST_COMPLETE:String			= "loadOrgListComplete";
		public static const LOAD_ORGLIST_FAILED:String			= "loadOrgListFailed";
		public static const LOAD_NAMESEARCH_COMPLETE:String		= "loadNameSearchComplete";
		public static const LOAD_NAMESEARCH_FAILED:String		= "loadNameSearchFailed";

		public static const LOAD_USEDCARDLIST_COMPLETE:String	 = "loadUsedCardListComplete";
		public static const LOAD_USEDCARDLIST_FAILED:String	 	= "loadUsedCardListFailed";
		public static const LOAD_GASCOST_COMPLETE:String		= "loadGasCostComplete";
		public static const LOAD_GASCOST_FAILED:String			= "loadGasCostFailed";
		public static const LOAD_BUDGET_COMPLETE:String			= "loadBudgetComplete";
		public static const LOAD_BUDGET_FAILED:String			= "loadBudgetFailed";
//shgoo : 2009.06.01
		public static const LOAD_BUDGET_DAILY_REQUEST:String	= "loadBudgetDailyRequest";
////////////////

		public static const LOAD_NOTE_URL_COMPLTE:String		= "loadNoteUrlComplete";
		public static const LOAD_NOTE_URL_FAILED:String			= "loadNoteUrlFailed";

		public static const LOAD_EXCHANGE_RATE_COMPLETE:String	= "loadExchangeRateComplete";
		public static const LOAD_EXCHANGE_RATE_FAILED:String	= "loadExchangeRateFailed";

		public static const SELECTED_MEMBER:String				= "selectedMemeber";
		public static const PERSONAL_DOMESTIC_ADJUSTMENT:String	= "personalDomesticAdjust";
		public static const PERSONAL_FOREIGN_ADJUSTMENT:String	= "personalForeignAdjust";
		public static const PERSONAL_DOMESTIC_ADJUSTMENT_READONLY:String	= "personalDomesticAdjustReadOnly";
		public static const PERSONAL_FOREIGN_ADJUSTMENT_READONLY:String	= "personalForeignAdjustReadOnly";

		public static const CONFIRM_DOMESTIC_ADJUST_INPUT:String	= "confirmDomesticAdjustInput";
		public static const CONFIRM_FOREIGN_ADJUST_INPUT:String		= "confirmForeignAdjustInput";
		public static const CANCEL_DOMESTIC_ADJUST_INPUT:String		= "cancelDomesticAdjustInput";
		public static const CANCEL_FOREIGN_ADJUST_INPUT:String		= "cancelForeignAdjustInput";

		public static const TYPE_DAILY_BIZTRIP:String			= "03";
		public static const TYPE_DOMESTIC_BIZTRIP:String		= "01";
		public static const TYPE_FOREIGN_BIZTRIP:String			= "02";

		public function BizTripFacade( key:String )
		{
			super(key);
		}

        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ):BizTripFacade
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new BizTripFacade( key );
            return instanceMap[ key ] as BizTripFacade;
        }
        /**
         * Register Commands with the Controller
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController() : void {
            super.initializeController();
            registerCommand( STARTUP, StartupCommand);
        }

        /**
         * Module의 시작점으로 Certificate.mxml의 creationComplete 이벤트에서 호출한다.
         *
         */
        public function startup(app:Object) :void
        {
        	trace("send startup in Work");
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }

	}
}